import { Component, OnInit, Input, Injector, ViewChild, Output, EventEmitter } from '@angular/core';
import { NgZorroPageBaseComponent } from '../../core/ng-zorro-page-base-component/ng-zorro-page-base-component.component';
import { HttpService } from "../../core/service/http.service";
import { Router, Route, ActivatedRoute } from "@angular/router";
import {
	AndOr, Compare, ExpressionPair, PagedResultDto, PagerSearchInput, ElementViewType, BaseComponentConfig,
	SystemFormControl, FieldType, CustomNavigation, ElementShowType, KeyValueOutput, SystemFormControlOutput, NavigatType, ArSystemFormControl
} from "../..";
import { NzMessageService, NzModalService } from 'ng-zorro-antd';
import {
	FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators,
	FormControl
} from "@angular/forms";
import { Faculty } from "../../core/model/ClassInfoDto";

// import { SearchaddresComponent } from "../Searchaddres/Searchaddres.component";

@Component({
	selector: 'app-student-test',
	templateUrl: './faculty.component.html',
	styleUrls: ['../../core/ng-zorro-page-base-component/ng-zorro-page-base-component.component.scss']
})
export class FacultymanageComponent extends NgZorroPageBaseComponent implements OnInit {
	uploading = false;
	ngOnInit() {
		this.IniObserver.subscribe(sb => {
			this.getEntityList();
		});

	}

	constructor(
		injector: Injector,
		public http: HttpService,
		private modal: NzModalService
	) {
		super(injector,
			new BaseComponentConfig(
				"School/GetAllDepartment",
				"School/CreatDepartment",
				"School/UpdateDepartment",
				"School/GetDepartment",
				"School/DeleteDepartment",
				"id",
				'',
				'',
			),
			new ArSystemFormControl(
				new Array<SystemFormControl>(
					new SystemFormControl("collegeDepartmentName", "院系名称", FieldType.Text, true, 30, 0, "", "", true, null, null),
					new SystemFormControl("remarks", "备注", FieldType.MultipleText, false, 30, 0, "", "", true, null, null),
				)
			)
		);
		this.showTitile = false;

	}

	getNewEntity(): Faculty {
		return new Faculty();
	}

	navigateCustom(url: string, pid: any) {
	}
	showModalForComponent(entity: any) {
	}
	// facultysch(e) {
	// 	this.listSearchValue = [
	// 		new ExpressionPair('address', "", Compare.Contains, AndOr.And),
	// 		new ExpressionPair('schoolId', "", Compare.Contains, AndOr.And),
	// 		new ExpressionPair('academeId', "", Compare.Contains, AndOr.And),
	// 		new ExpressionPair('collegeDepartmentId', "", Compare.Contains, AndOr.And),
	// 		new ExpressionPair('collegeDepartmentName', "", Compare.Contains, AndOr.And),
	// 	];
	// 	if (e === "fal") {
	// 		this.listSearchValue[0].propertyValue = "";
	// 		this.listSearchValue[1].propertyValue = "";
	// 		this.listSearchValue[2].propertyValue = "";
	// 		this.listSearchValue[3].propertyValue = "";
	// 		this.listSearchValue[4].propertyValue = "";
	// 	} else {
	// 		let address = e[0];
	// 		let schoolId = e[1];
	// 		let academeId = e[2];
	// 		let collegeDepartmentId = e[3];
	// 		let collegeDepartmentName = e[4];
	// 		if (address === undefined + "-" + undefined) {
	// 			address = "";
	// 		}

	// 		if (schoolId === undefined) {
	// 			schoolId = "";
	// 		}
	// 		if (academeId === undefined) {
	// 			academeId = "";
	// 		}
	// 		if (collegeDepartmentId === undefined) {
	// 			collegeDepartmentId = "";
	// 		}
	// 		if (collegeDepartmentName === undefined) {
	// 			collegeDepartmentName = "";
	// 		}
	// 		this.listSearchValue[0].propertyValue = address;
	// 		this.listSearchValue[1].propertyValue = schoolId;
	// 		this.listSearchValue[2].propertyValue = academeId;
	// 		this.listSearchValue[3].propertyValue = collegeDepartmentId;
	// 		this.listSearchValue[4].propertyValue = collegeDepartmentName;
	// 	}

	// 	this.getEntityList();

	// 	// this.listSearchValue = [

	// 	// 	new ExpressionPair('collegeDepartmentName', "", Compare.Contains, AndOr.And),
	// 	// 	// new ExpressionPair('remarks', "", Compare.Contains, AndOr.And),
	// 	// 	new ExpressionPair('Cid', "", Compare.Equal, AndOr.And),
	// 	//   ];

	// 	// 	this.listSearchValue[0].propertyValue = name;
	// 	// 	this.listSearchValue[0].compare = 0;
	// 	// 	// this.listSearchValue[1].propertyValue = name;
	// 	// 	// this.listSearchValue[1].compare = 0;
	// 	// 	this.listSearchValue[1].propertyValue = xname;
	// 	// 	this.listSearchValue[1].compare = 0;
	// 	//   this.getEntityList();
	// }

}


